<template>
	<view class="service-center">
	
		<block v-if="list.length">
			<view v-for="(item,index) in 1" :key="index">
				<view class="code">
					<image :src="imgRemote+codeImg" mode="widthFix" />
					<view class="code-text fs-13">客服二维码</view>
				</view>

				<view class="contact" @click="telphone(tel)">
					<text class="iconfont icon-show_dianhua_full"></text>
					服务热线：{{tel}}
				</view>
			</view>
		</block>

		<view class="bitmap-img center" v-else>
			<image src="../../static/img/no_content.png" mode="widthFix"></image>
			<view>暂时没有哦~</view>
		</view>
	</view>
</template>

<script>
	let {
		imgRemote
	} = getApp().globalData;
	export default {
		data() {
			return {
				imgRemote: imgRemote,
				list: [1],
				tel:'',
				codeImg:''
			}
		},
		methods: {
			getList() {
				this.$get(this.$api.mainKefu, this.form, (res) => {
					let data = res.data;
					if (data.code == 1) {
						this.list = data.data;
					}
				});
			},
			telphone(phone) {
				uni.makePhoneCall({
					phoneNumber: phone
				});
			},
			getPhone(){
				this.$get(this.$api.uTel,{},(res)=>{
					this.tel=res.data.data;
				})
			}
		},
		onLoad() {
			this.$get(this.$api.configLists, {
				name: '微信二维码'
			}, (res) => {
				if (res.data.code == 1) {
					// arr2.push(res.data.data[0].value);
					this.codeImg = res.data.data[0].value;
				}
			});
			this.getPhone()
			this.getList()
		}
	}
</script>

<style lang="scss" scoped>
	.service-center {
		min-height: 100vh;
		background-color: white;

		.code {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			image{width: 260rpx;}
		}

		.code-text {
			margin: 30rpx 0 0rpx;
		}

		.contact {
			width: 600rpx;
			height: 78rpx;
			border-radius: 39rpx;
			margin: 30rpx auto;
			background: $m-c;
			color: white;
			display: flex;
			align-items: center;
			justify-content: center;

			.icon-show_dianhua_full {
				margin: 2rpx 10rpx 0 0;
			}
		}
.bitmap-img{padding-top: 80rpx;}
	}
</style>
